LinFeiOffical::Application.routes.draw do

  root "home#index"

  get "/introduces/show/:flag", to: "introduces#show"

  resources :posts do
    member do
      get :previous, :next
    end
  end

  resources :products

  resources :banners

  get '/about/description', to: "about#description",  as: "description_about"
  get '/about/job',         to: "about#job",          as: "job_about"
  get '/about/contact',     to: "about#contact",      as: "contact_about"

  get "login", to: "sessions#new", as: "login"
  get "quit",  to: "sessions#destroy", as: "quit"

  resources :sessions, only: [:create]

  namespace :cpanel do

    root "base#index"

    get "/introduces/show/:flag/:language", to: "introduces#show"

    get "/contacts/show/:language", to: "contacts#show"

    resources :banners

    resources :users, only:[:edit, :update]

    resources :posts

    resources :photos

    resources :products do
      resources :photos
    end

    resources :jobs

    resources :introduces, only: [:edit, :update]

    resources :contacts, only: [:edit, :update]


  end

end
